package file;

import java.io.File;
import java.io.IOException;

public class CreateNewFileDemo {
    public static void main(String[] args) throws IOException {

        for (int i= 1;i<11;i++){
            File file = new File("./test"+i+".txt");
            if (!file.exists()){
                file.createNewFile();
            }
        }











        /*
        File file = new File("./黄总别睡了.txt");
        if (file.exists()){
            System.out.println("文件已存在");
        }else {
            file.createNewFile();
            System.out.println("文件创建成功");
        }

         */

    }
}
